package jsyf.oa.entity.device;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * Created by jjx on 2018/3/8.
 */
@Entity
@Table(name = "T_DVC_MODEL", schema = "oa", catalog = "")
public class DeviceModelEntity extends BaseEntity {

    private String modelName;

    private String brandId;

    private int sortNo;

    private BigDecimal lowestPrice;

    private BigDecimal tonConfig;

    private String bucketCapacity;

    private String deviceTypeId;

    private String remark;

    private String config;

    public BigDecimal getTonConfig() {
        return tonConfig;
    }

    public void setTonConfig(BigDecimal tonConfig) {
        this.tonConfig = tonConfig;
    }

    public String getDeviceTypeId() {
        return deviceTypeId;
    }

    public void setDeviceTypeId(String deviceTypeId) {
        this.deviceTypeId = deviceTypeId;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

    public String getBrandId() {
        return brandId;
    }

    public void setBrandId(String brandId) {
        this.brandId = brandId;
    }

    public BigDecimal getLowestPrice() {
        return lowestPrice;
    }

    public void setLowestPrice(BigDecimal lowestPrice) {
        this.lowestPrice = lowestPrice;
    }

    public String getBucketCapacity() {
        return bucketCapacity;
    }

    public void setBucketCapacity(String bucketCapacity) {
        this.bucketCapacity = bucketCapacity;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public int getSortNo() {
        return sortNo;
    }

    public void setSortNo(int sortNo) {
        this.sortNo = sortNo;
    }

    public String getConfig() {
        return config;
    }

    public void setConfig(String config) {
        this.config = config;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("BRAND_ID", this.getBrandId());
        obj.put("MODEL_NAME", this.getModelName());
        obj.put("LOWEST_PRICE", this.getLowestPrice());
        obj.put("BUCKET_CAPACITY", this.getBucketCapacity());
        obj.put("DEL_FLAG", this.getDelFlag());
        obj.put("DEVICE_TYPE_ID",this.getDeviceTypeId());
        obj.put("SORT_NO", this.getSortNo());
        obj.put("REMARK", this.getRemark());
        obj.put("CONFIG", this.getConfig());
        obj.put("TON_CONFIG", this.getTonConfig());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_DVC_MODEL";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("BRAND_ID", "brandId");
        obj.put("MODEL_NAME", "modelName");
        obj.put("LOWEST_PRICE", "lowestPrice");
        obj.put("BUCKET_CAPACITY", "bucketCapacity");
        obj.put("DEL_FLAG", "delFlag");
        obj.put("DEVICE_TYPE_ID","deviceTypeId");
        obj.put("REMARK", "remark");
        obj.put("SORT_NO", "sortNo");
        obj.put("CONFIG", "config");
        obj.put("TON_CONFIG", "tonConfig");

        return obj;
    }
}
